/* list.h: classical linked list (of integer) */
 
#ifndef _LIST_H_
#define _LIST_H_
 
/* The type for linked list: a pointer to some struct (hidden) */
typedef struct s_list  *list;
 
/* empty ops can be done using macro */
#define list_empty()            (NULL)
#define list_is_empty(l)        (!(l))
 
/* usual operations */
 
/* list_len(l) return the size of the list */
size_t  list_len        (list l);
 
/* list_add(l,x) return a list with head x and tail l */
list    list_add        (list l, int x);
 
/* list_destroy(l) completely free every element of l */
void    list_destroy    (list l);
 
/* list_print(l) print every element in l *
 *  * with format: [ x0; ..; xn; ]           */
void    list_print(list l);
 
#endif
 
/* list.h : end */

